<script setup>
import {ref} from 'vue'
const upload = ref()
const submitUpload = () => {
  upload.value.submit()
}
</script>

<template>
  <hr>
  <h2>vue3 elementplus file upload</h2>
  <el-upload
      ref="upload"
      action="http://localhost:8080/uploads"
      multiple
      :auto-upload="false"
      :limit="2"
  >
    <template #trigger>
      <el-button type="primary" size="small">选择文件，最多选两个文件</el-button>
    </template>

  <el-button type="success" @click="submitUpload" size="small">开始上传</el-button>
  <template #tip>可以上传文件</template>
  </el-upload>
</template>
